home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PowerGen
/
PowerGen CD-ROM.ISO
/
Win95_NT
/
Gamezone
/
ENGAGE
/
SYSTEM
/
PLUGINIE
/
SETUP.RUL
< prev
next >
Wrap
Text File
|
1997-11-05
|
25KB
|
580 lines
/***************************************************************************/
/*** ***/
/*** Setup.Rul ***/
/*** ***/
/*** This is the Setup.Rul file for the Internet Explorer Engage ***/
/*** System Components. ***/
/*** ***/
/***************************************************************************/
/*** ***/
/*** Version Information: ***/
/*** ***/
/*** Version Date Initials Notes ***/
/*** ******* ******** ******** ***** ***/
/*** 1.5.16 07/22/97 SEH Added Buttonbar Local Store ***/
/*** 1.5.15 07/22/97 SEH Rev-ed to keep up with Nav. ***/
/*** 1.5.14 07/10/97 SEH Rev-ed to keep up with Nav. ***/
/*** 1.5.13 05/12/97 SEH Two installs now generated, ***/
/*** one with LS and one w/o. ***/
/*** 1.5.12 03/31/97 SEH Added iChat v2.22 ***/
/*** 1.5.11 03/31/97 SEH Updated Local Store ***/
/*** 1.5.10 03/31/97 SEH Fixed a registry bug ***/
/*** 1.5.09 03/31/97 SEH Added new ICAML.EXE v1.43 ***/
/*** 1.5.08 03/31/97 SEH Updated Local Store ***/
/*** 1.5.07 03/31/97 SEH Various Updates ***/
/*** 1.5 02/24/97 SEH Update with versioning info ***/
/*** 1.1 02/03/97 SEH Baseline ***/
/*** ***/
/***************************************************************************/
/*** ***/
/*** Version 1.5.13 ***/
/*** ************** ***/
/*** This version of the system components is a change in how it is ***/
/*** compiled. The m.bat file that builds the entire self-extracting ***/
/*** zipfile builds the system components without local storage and ***/
/*** mls.bat builds the system components with local storage. ***/
/*** ***/
/*** Version 1.5.07 ***/
/*** ************** ***/
/*** Up to this point, there have been alot of updates to the ***/
/*** NPEOVER.DLL, with a few updates to the actual script. These ***/
/*** updates include: ***/
/*** 1. A Local store was added to the system components that holds ***/
/*** alot of the WWW site information so that it does not require ***/
/*** download. The system components now check for this on a ***/
/*** user's computer and deletes it before installing the new one. ***/
/*** 2. Checks the Java and JavaScript settings and verifies they are ***/
/*** enabled. If they are not, the user can enable them in this ***/
/*** install. ***/
/*** 3. If the user has multiple instances of the browser running, ***/
/*** the user will be prompted to close each one of them ***/
/*** 4. The system components now check for the version of the ***/
/*** browser installed on a user's system and only prompts the ***/
/*** user if his version is not supported. ***/
/*** 5. System Components install path. ***/
/*** 6. Various other text message changes. ***/
/*** ***/
/*** Version 1.5 ***/
/*** *********** ***/
/*** This version has several changes: ***/
/*** 1. Calls UEngage1.Exe that updates the game client applications ***/
/*** with the versioning information for v1.5. ***/
/*** 2. While searching for IEXPLORE.EXE, a message is displayed ***/
/*** telling the user what is happening. If it cannot find it, ***/
/*** it prompts the user for the IE Plug-Ins path. ***/
/*** 3. At the beginning of the install, it searches for IE running ***/
/*** and asks the user if he wants it closed. No close = abort ***/
/*** install. ***/
/*** ***/
/*** Version 1.1 ***/
/*** *********** ***/
/*** This is the first version of this file that I have rewritten. ***/
/*** The original was written by John Spence. This version contains ***/
/*** DirectX Version checking and an additional set of registry ***/
/*** entries that tell game clients the path to both Plug-Ins and ***/
/*** System Components. ***/
/*** ***/
/***************************************************************************/
declare
#include "SdDialog.h"
#include "DirectX.h"
#include "Browsers.h"
#include "Constant.h"
#include "IEHeader.h"
// Update Engage Applications Tool declarations.
#define UENGAGE1_EXE "UEngage1.Exe"
#define UENGAGE1_OPTIONS "-s"
// Constant declarations.
#define SPACE_REQUIRED 2000000 // Disk space in bytes.
#define APP_NAME "GamesZone System Components"
#define APPBASE_PATH "Program Files\\Engage\\IE"
#define COMPANY_NAME "GamesZone"
#define PRODUCT_NAME "GamesZone System Components"
#define PRODUCT_VERSION "1.5.16"
#define DEINSTALL_KEY "EngageSystemIEDeinstKey"
#define UNINSTALL_NAME "GamesZone System Components for Internet Explorer"
#define PRODUCT_KEY "EngageIE"
// Global variable declarations.
STRING svFolder, svDir, szMsg, szFileSet, szTitle, svUninstLogFile;
STRING svTarget, szProgram, szParam, szTemp, szAppPath, szSource;
STRING szKey, szMimeType, szExec, svValue, svString, szExtension;
STRING szExtFile, svEditFlags, szExtFileKey;
STRING szDialogMsg;
BOOL bSpaceOk;
NUMBER nResult, nReturn, nvType, nvSize, nTypeIndex, nDirectXVersion;
// Function declarations.
prototype SetupScreen();
prototype CheckRequirements();
prototype GetHandAndLaunchAppWait(STRING, STRING, STRING, STRING, LONG);
prototype KERNEL32.Sleep(LONG);
prototype AddApplicationPathsToRegistry();
program
StartHere:
Disable( BACKGROUND );
// Set installation info., which is required for registry entries.
InstallationInfo( COMPANY_NAME, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY );
// Set up the installation screen.
SetupScreen();
Enable( DIALOGCACHE );
// Create a Welcome dialog.
WelcomeDlg:
Disable( BACKBUTTON );
Welcome( "", 0 );
Enable( BACKBUTTON );
// Test target system for proper configuration.
CheckRequirements();
// Ask user for a destination location for the installation.--
GetTargetDirectory:
svTarget = TARGETDISK ^ APPBASE_PATH; //ex. C:\progra~1\engage
szMsg = "";
if ( AskDestPath( "", szMsg,
svTarget, 0 ) = 12 ) then
goto WelcomeDlg;
endif;
// Perform space check of target drive.
bSpaceOk = TRUE;
if (GetDiskSpace( svTarget ) < SPACE_REQUIRED) then
szMsg = "There is not enough space available on the disk\n" +
"'" + svTarget + "' \n" +
"Please free up some space or change the target location\n" +
"to a different disk";
MessageBox( szMsg, WARNING );
bSpaceOk = FALSE;
endif;
// If not enough space, ask user to try again.
if (bSpaceOk = FALSE) goto GetTargetDirectory;
DeleteOldLocalStore:
if (ExistsDir(svTarget^"Local Store") = EXISTS) then
DeleteDir (svTarget^"Local Store", ALLCONTENTS);
endif;
SetupFilesToTransfer:
szFileSet = "General";
TARGETDIR = svTarget;
// Define the file set.
FileSetBeginDefine( szFileSet );
SetStatusWindow( -1, "Copying program files..." );
// Uncompress files from installation library
CompressGet( "DATA.Z", "*.*", INCLUDE_SUBDIR );
FileSetEndDefine( szFileSet );
TransferFiles:
// Prepare InstallShield to record deinstallation information.
DeinstallStart( svTarget, svUninstLogFile, DEINSTALL_KEY, 0 );
RegDBSetItem( REGDB_UNINSTALL_NAME, UNINSTALL_NAME );
// Set up progress indicator and information gauge.
Disable( DIALOGCACHE );
Enable( STATUSDLG );
StatusUpdate( ON, 90 );
// Perform the file set.
SetStatusWindow( 0, "Copying program files..." );
nResult = FileSetPerformEz( szFileSet, 0 );
switch (nResult)
case FS_DONE: // Successful completion.
case FS_CREATEDIR: // Create directory error.
MessageBox( "Unable to create a directory under " + TARGETDIR + "."+
"Please check write access to this directory.", SEVERE );
exit;
default: // Group all other errors under default label.
NumToStr( szTemp, nResult );
MessageBox( "General file transfer error."+
"Please check your target location and try again."+
"\n\n Error Number:"+szTemp +
"\n Related File: "+ERRORFILENAME,
SEVERE );
exit;
endswitch;
SetRegistryEntries:
// Set the Base Key for Internet Explorer Registry entries
RegDBSetDefaultRoot (HKEY_CLASSES_ROOT);
// Set variables for Internet Explorer Viewer configuration entries
szKey = "\\MIME\\Database\\Content Type";
szMimeType = "application/x-engage";
szExec = "\"" + svTarget ^ "ICAML.EXE\"";
szExtension = ".ego";
szExtFile = "egofile";
szExtFileKey = "\\egofile";
// Set Mime Registry entry
if (RegDBCreateKeyEx(szKey ^ szMimeType, "") < 0) then
MessageBox("Failed to create Mime key", WARNING);
else
if (RegDBSetKeyValueEx(szKey ^ szMimeType, "Extension", REGDB_STRING, szExtension, -1) < 0) then
MessageBox("Failed to set Mime key Extension value", WARNING);
endif;
endif;
// Set Extension Registry entry
if (RegDBCreateKeyEx(szExtension, "") < 0) then
MessageBox("Failed to create Extension key", WARNING);
else
if (RegDBSetKeyValueEx(szExtension, "", REGDB_STRING, szExtFile, -1) < 0) then
MessageBox("Failed to set Extension key Default value", WARNING);
endif;
if (RegDBSetKeyValueEx(szExtension, "Content Type", REGDB_STRING, szMimeType, -1) < 0) then
MessageBox("Failed to set Extension key Content Type value", WARNING);
endif;
endif;
// Set Extension File Registry entry
if (RegDBCreateKeyEx(szExtFileKey, "") < 0) then
MessageBox("Failed to create Extension File key", WARNING);
else
if (RegDBSetKeyValueEx(szExtFileKey, "", REGDB_STRING, "Engage Launch Document", -1) < 0) then
MessageBox("Failed to set Extension File key Default value", WARNING);
endif;
SetByte(svEditFlags, 0, 0);
SetByte(svEditFlags, 1, 0);
SetByte(svEditFlags, 2, 1); /* cause IE to always open */
SetByte(svEditFlags, 3, 0);
if (RegDBSetKeyValueEx(szExtFileKey, "EditFlags", REGDB_BINARY, svEditFlags, 4) < 0) then
MessageBox("Failed to set Extension File key EditFlags value", WARNING);
endif;
if (RegDBCreateKeyEx(szExtFileKey ^ "Shell", "") < 0) then
MessageBox("Failed to create Extension File Shell key", WARNING);
else
if (RegDBCreateKeyEx(szExtFileKey ^ "Shell" ^ "open", "") < 0) then
MessageBox("Failed to create ExtFile Shell open key", WARNING);
else
if (RegDBCreateKeyEx(szExtFileKey ^ "Shell" ^ "open" ^ "command", "") < 0) then
MessageBox("Failed to create ExtFile Shell open command key", WARNING);
else
szKey = szExtFileKey ^ "Shell" ^ "open" ^ "command";
if (RegDBSetKeyValueEx(szKey, "", REGDB_STRING, szExec + " %1", -1) < 0) then
MessageBox("Failed to set ExtFile Shell open command Default value", WARNING);
endif;
endif;
endif;
endif;
endif;
// VarRestore(SRCTARGETDIR);
Delay( 1 );
Disable( STATUSDLG );
// Create/Update Engagego.ini in the Windows directory
nReturn = LaunchAppAndWait(svTarget ^ "egosetup.exe","",WAIT);
if (nReturn < 0) then
szMsg = "Launch of egosetup failed\n";
MessageBox( szMsg, WARNING );
endif;
// Install the Ichat plug-in for Internet Explorer
if (GetHandAndLaunchAppWait(SRCDIR ^ "icie222.exe", "", "InstallShield_Win", "Setup", WAIT) < 0) then
MessageBox("Ichat EXE launch failed\n", WARNING);
endif;
UpdateApplications:
szDialogMsg="Setup is checking for any installed games...";
SdShowMsg (szDialogMsg, TRUE);
LaunchAppAndWait(UENGAGE1_EXE, UENGAGE1_OPTIONS, WAIT);
SdShowMsg (szDialogMsg, FALSE);
SetupEngageRegistryPaths:
AddApplicationPathsToRegistry();
// Announce setup complete and offer to read README file.
FinalInstallProcess:
SetStatusWindow( 100, "Installation complete." );
GetDirectXVersion:
nDirectXVersion=CheckDirectXVersion();
if (nDirectXVersion=0) then
szMsg = COMPLETE_DX3;
//szMsg = "Setup of the GamesZone System Components for Microsoft Internet Explorer " +
// "is complete. You must install DirectX before you can play any of the " +
// "GamesZone Online Games. DirectX is available at www.gameszone.net.";
else
szMsg = COMPLETE_NODX3;
//szMsg = "Setup is complete. You will be able to access GamesZone games online at"+
// "at www.gameszone.net the next time you start Microsoft Internet Explorer.";
endif;
//MessageBox( szMsg, INFORMATION );
LaunchIE:
//szMsg = szMsg + "\n\nWould you like to connect to www.gameszone.net now?";
szMsg = szMsg + WWW_LAUNCH_TEXT;
if (AskYesNo(szMsg, YES) = YES) then
LaunchInternetExplorer (WWW_LAUNCH_SITE);
endif;
exit;
#include "SdDialog.Rul"
#include "DirectX.Rul"
#include "Browsers.Rul"
/*---------------------------------------------------------------------------*\
*
* Function: SetupScreen
*
* Purpose: This function will set up the screen look. This includes
* colors, fonts, text to be displayed, etc.
*
*
* Input:
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function SetupScreen()
number nDx, nDy;
begin
GetExtents( nDx, nDy );
Enable( FULLWINDOWMODE );
Enable( INDVFILESTATUS );
Enable( BITMAP256COLORS );
SetTitle( "Installing " + APP_NAME, 24, WHITE );
SetColor( BACKGROUND, BK_BLUE ); // Dark blue.
SetColor( STATUSBAR, BLUE ); // Bright blue.
SetTitle( "Engage", 0, BACKGROUNDCAPTION ); // Caption bar text.
Enable( BACKGROUND );
Delay( 1 );
end;
/*---------------------------------------------------------------------------*\
*
* Function: CheckRequirements
*
* Purpose: This function will check all minimum requirements for the
* application being installed. If any fail, then the user
* is informed and the installation is terminated.
*
*
* Input:
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function CheckRequirements()
number nvResult;
STRING svResult, szKey;
begin
// Determine the target system's operating system.
GetSystemInfo( OS, nvResult, svResult );
if (nvResult != IS_WINDOWS95) then
MessageBox( "This program requires the Windows 95 Operating System.", WARNING);
exit;
endif;
// Check Internet Explorer Version
if (!CheckBrowserVersion ("Internet Explorer", "3.0")) then
// Ask user to verify Internet Explorer version
if (AskYesNo("This program requires Microsoft Internet Explorer version 3.0 or better!\n" +
"Would you like to continue?", YES) = NO) then
MessageBox("Installation terminated by the user!", WARNING);
exit;
endif;
endif;
// Look in the Registry for the Internet Explorer key
RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
szKey = "\\SOFTWARE\\Microsoft\\Internet Explorer";
if (RegDBKeyExist(szKey) < 0) then
MessageBox( "Unable to locate Internet Exlorer registry entries", WARNING);
exit;
endif;
// Make sure that Internet Explorer is not running!
CloseInternetExplorer();
// Check for Explorer Java settings
if (!CheckExplorerJavaSettings()) then
if (AskYesNo("In order to access the GamesZone WWW site, Java and JavaScript must be enabled.\n" +
"Would you like to enable them?", YES) = NO) then
if (AskYesNo("Would you like to continue with the installation?", YES) = NO) then
MessageBox("Installation terminated by the user!", WARNING);
exit;
endif;
else
SetExplorerJavaSettings();
endif;
endif;
end;
function GetHandAndLaunchAppWait(szProgram,
szCmdLine,
szClassName,
szWinName,
lWait)
NUMBER n, icnt;
HWND hwnd;
begin
n = LaunchApp(szProgram, szCmdLine);
if lWait = WAIT then
if n = 0 then
hwnd = NULL;
icnt = 15000; // So the routine will exit if the Launched App failed
// Wait for the specified window handle to appear
while ((hwnd = NULL) && (icnt > 0))
Sleep(0);
hwnd = FindWindow(szClassName, szWinName);
icnt = icnt - 1;
endwhile;
// Wait for the specified window handle to disappear
while (hwnd != NULL)
Sleep(0);
hwnd = FindWindow(szClassName, szWinName);
endwhile;
endif;
endif;
return n;
end;
/***************************************************************************/
/*** ***/
/*** AddApplicationPathsToRegistry ***/
/*** ***/
/*** This function will add the Plug-In path and System path for the ***/
/*** Internet Explorer setup. ***/
/*** ***/
/*** It gets the Plug-In path by searching for IEXPLORE.EXE and ***/
/*** concatinating "PlugIns" to it. It then prompts the user with ***/
/*** this directory for confirmation or for an entry if it does not ***/
/*** find IEXPLORE.EXE. ***/
/*** ***/
/*** and the System path from szTarget. ***/
/*** ***/
/*** It puts this information in: ***/
/*** [HKEY_LOCAL_MACHINE\Software\Engage Games Online\ ***/
/*** Engage System Components] ***/
/*** "PlugInPath"= ***/
/*** "SystemPath"= ***/
/*** ***/
/***************************************************************************/
function AddApplicationPathsToRegistry()
STRING szPlugInPath, szSearchPath, szRegValue, szDialogMsg, szIEPath;
NUMBER nPos, nSearchResult, nFound, nvType, nvSize, nvByte;
begin
// Get IEXPLORE.EXE directory
RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
if( !RegDBGetKeyValueEx(IEXPLORE_EXE_KEY, PATH_KEY, nvType, szIEPath, nvSize) < 0 ) then
// Strip off ';'
nPos = StrFind(szIEPath,";");
SetByte(szIEPath, nPos, 0);
szPlugInPath = szIEPath ^ "PlugIns";
endif;
if (ExistsDir(szPlugInPath)=NOTEXISTS) then
AskPath( "Please enter your Internet Explorer Plug-Ins directory", szPlugInPath, szPlugInPath);
endif;
// Set registry values
// Set the base key for these entries
RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
// Set key that we are going to create entries under
//szKey = SYSTEM_COMPONENTS_KEY;
szKey = IE_VERSIONING_KEY;
// Create Key
RegDBCreateKeyEx( szKey, "" );
// Add entries under key
// Strip off trailing slash after System Path
szRegValue = svTarget;
nPos = StrLength(szRegValue);
nPos--;
GetByte (nvByte, szRegValue, nPos);
while (nvByte=92)
nPos--;
GetByte (nvByte, szRegValue, nPos);
endwhile;
nPos++;
SetByte (szRegValue, nPos, 0);
// Add System path to registry
RegDBSetKeyValueEx( szKey, SYSTEM_PATH_KEY, REGDB_STRING, szRegValue, -1 );
// Strip off trailing slash after Plug-In path
szRegValue = szPlugInPath;
nPos = StrLength(szRegValue);
nPos--;
GetByte (nvByte, szRegValue, nPos);
while (nvByte=92)
nPos--;
GetByte (nvByte, szRegValue, nPos);
endwhile;
nPos++;
SetByte (szRegValue, nPos, 0);
// Add Plug-In path to registry
RegDBSetKeyValueEx( szKey, PLUG_IN_PATH_KEY, REGDB_STRING, szRegValue, -1 );
// Copy Versioning DLL to the Plug-In Path
VarSave(SRCTARGETDIR);
TARGETDIR = szPlugInPath;
CopyFile("NPeover.dll", "NPeover.dll");
VarRestore(SRCTARGETDIR);
end;